from rest_framework.serializers import ModelSerializer
from course import models
class CateSerializer(ModelSerializer):
    class Meta:
        model = models.CategoryModel
        fields = ["id","name"]

class CategorySerializer(ModelSerializer):
    son =CateSerializer(many=True)
    class Meta:
        model = models.CategoryModel
        fields = ["id","name","son"]


class CourseSerializer(ModelSerializer):
    class Meta:
        model = models.CourseModel
        fields = "__all__"



class TeacherSerializer(ModelSerializer):
    class Meta:
        model = models.TeacherModel
        fields = ["name","image","jobtitle"]
